#ifndef SERVER_H
#define SERVER_H

#include <QTcpServer>

class Server : public QTcpServer
{
    Q_OBJECT
public:
    explicit Server(const QString &saveDir, QObject *parent = nullptr);

protected:
    void incomingConnection(qintptr socketDescriptor) override;

private slots:
    void readClient();
    void discardClient();

private:
    void saveReceivedFile(const QByteArray &data);
    QString m_saveDir;
};

#endif // SERVER_H
